package cn.chencaiju.day11;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

import org.junit.Test;

public class OutputStreamWriterTest {
	@Test public void testWriter() {
		
		try(
			OutputStreamWriter writer=new OutputStreamWriter(new FileOutputStream("write.txt"),"utf-8")
			)
		{
			writer.write("中国乒乓球");
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
	}
}
